package com.tools.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * https://www.cnblogs.com/chenyanbin/archive/2020/08/12/13473132.html
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Document(indexName = "nba")
@TableName("nba_player")
public class NBAPlayer implements Serializable {
    private static final long serialVersionUID = 5903863814387591353L;

    @Id //id作为_id进行映射
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    private String countryEn;
    @Field(type = FieldType.Keyword)
    private String country;
    private String code;
    private String displayAffiliation;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String displayName;
    private Integer draft;
    private String schoolType;
    private String weight;
    private Integer playYear;
    private String jerseyNo;
    private Long birthDay;
    private String birthDayStr;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String displayNameEn;
    private String position;
    private Double heightValue;
    private String playerId;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String teamCity;
    private String teamCityEn;
    @Field(type = FieldType.Keyword)
    private String teamName;
    private String teamNameEn;
    private String teamConference;
    private String teamConferenceEn;
    private Integer age;
}
